package com.ybc.chinese.utils;

import android.content.Context;

import com.ybc.chinese.db.DBManager;

/**
 * <p>缓存工具<p/>
 * Created by Yubch on 17/2/16.
 */
public class CacheUtil {
    /**
     * 保持缓存
     *
     * @param context
     * @param index
     * @param content
     */
    public static void saveCache(Context context, String index, String content) {
        DBManager.getInstance(context).setContent(index, content);
    }

    /**
     * 获取缓存
     *
     * @param context
     * @param index
     * @return
     */
    public static String getCache(Context context, String index) {
        String result = null;
        result = DBManager.getInstance(context).getContent(index);
        return result;
    }

    /**
     * 删除缓存
     *
     * @param context
     * @param index
     * @return
     */
    public static void delCache(Context context, String index) {
        DBManager.getInstance(context).delContent(index);
    }
}
